ACTOR QuadShotgun: BrutalWeapon
{
	Weapon.SelectionOrder 700
	Weapon.SlotPriority 1
	Weapon.KickBack 50
	Weapon.AmmoGive1 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType "AmmoShell"
	Weapon.AmmoType2 "QSSGAmmo"
	Weapon.AmmoUse 0
	Weapon.AmmoUse2 0
	Weapon.UpSound "weapons/quadshotgun/close"
	Inventory.PickupMessage "You got THE QUAD SHOTGUN!!!! (Slot 3)"
	Obituary "%o's brain exploded by %k's QUAD Shotgun."
	+WEAPON.AMMO_CHECKBOTH
	+WEAPON.NoAutoAim
	Tag "Quad Shotgun"
	Scale 0.9
	Inventory.ForbiddenTo Sorcerer, Corvus
	States
	{
		Spawn:	
			QSGS A -1
			Stop
		 
		Ready:
		Ready3:
		ReadyLoop:
			QBSG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
			TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
			TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			TNT1 A 0 A_SetCrosshair(40)		
			Loop	
			
			/*TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			
			TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 0, 2)
			QBSG A 0 A_JumpIfInventory("AmmoShell", 1, 2)
			QBSG A 1 A_WeaponReady
			Loop
			QBSG A 1 A_WeaponReady
			Loop*/
		
		Select:
			TNT1 A 0 A_Giveinventory("GoSpecial",1)
			TNT1 A 0 A_TakeInventory("TossGrenade", 1)
			//TNT1 A 0 A_GunFlash
			QBSG A 0 A_Raise
			Goto ReadyPlaceholder
			ReadyPlaceholder:
			SHSS A 0 
			TNT1 A 0 A_PlaySound("CLIPINSS")
			QSHS ABCDEF 1 A_WeaponReady(WRF_NOFIRE)
			Goto Ready
			
		Deselect:
			QSHS FEDCBA 1
			QBSG A 0 A_Lower
			Wait
			
		Fire:
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 1, 1)
			Goto NoAmmo
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 4, "TopDoubleFire")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 3, "DoubleFire")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 2, "DoubleFire")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 1, "AltFire2")
			Goto Ready
		QuadrupleFire:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 4, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/quadshotgun/fire")
			QBSG A 0 A_PlaySound("weapons/quadshotgun/kapow", 1)
			QBSG A 0 A_GunFlash

			TNT1 A 0 A_Recoil(8)
			pkab A 1 Bright Offset(0, 44) A_FireBullets(14, 10, 55, random(7, 14), "ShotPuff", 0)
			pkab B 1 Bright Offset(0, 49) A_AlertMonsters
			QBSG A 0 A_SetPitch(pitch + 1.2)
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-8, 8), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			QBSG A 0 A_SetPitch(pitch - 20)
			
			QBSG A 1 Offset(0, 46)
			QBSG A 1 Offset(0, 39)
			QBSG A 1 Offset(0, 33)
			QBSG A 8
			QBSG A 1
			Goto Ready
		TripleFire:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 3, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/quadshotgun/fire")
			QBSG A 0 A_GunFlash

			QBSG A 0 A_Recoil(6)
			PKAB A 1 Bright Offset(0, 34) A_FireBullets(11, 8, 40, random(7, 14), "ShotPuff", 0)
			PKAB B 1 Bright Offset(0, 37) A_AlertMonsters
			QBSG A 0 A_SetPitch(pitch + 1.0)
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-6, 6), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			QBSG A 0 A_SetPitch(pitch - 15)
			
			QBSG A 1 Offset(0, 36)
			QBSG A 1 Offset(0, 33)
			QBSG A 8
			QBSG A 1 A_Refire
			Goto Ready
		
		TopDoubleFire:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 2, TIF_NOTAKEINFINITE)
			QBSG A 0 A_playsound("SSHFIRE", 5)
			QBSG A 0 A_GunFlash
			QBSG A 0 A_JumpIfInventory("IsPaladin", 1, 3)
			QBSG A 0 A_JumpIfInventory("PowerStrength", 1, 2)
			TNT1 A 0 A_Recoil(4)
			SHO9 A 0 A_FireBullets (0,0,1,40,"shotpuff",FBF_NORANDOM,300)
			PKTA A 1 Bright //A_FireBullets(8, 6, 25, random(7, 14), "ShotPuff", 0)
			SHTZ A 0 A_FireBullets (10, 1, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			SHTZ A 0 A_FireBullets (6, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			PKTA B 1 Bright A_AlertMonsters
			TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
			TNT1 AAAAAAAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-4, 4), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			QBSG A 0 A_SetPitch(pitch - 10)
			
			QSGK AABBCDDEF 1 A_SetPitch(pitch + 1.0)
			QBSG A 2 
			Goto Ready
			
		DoubleFire:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 2, TIF_NOTAKEINFINITE)
			QBSG A 0 A_playsound("SSHFIRE", 5)
			QBSG A 0 A_GunFlash
			QBSG A 0 A_JumpIfInventory("IsPaladin", 1, 3)
			QBSG A 0 A_JumpIfInventory("PowerStrength", 1, 2)
			TNT1 A 0 A_Recoil(4)
			SHO9 A 0 A_FireBullets (0,0,1,40,"shotpuff",FBF_NORANDOM,300)
			PKBA A 1 Bright //A_FireBullets(8, 6, 25, random(7, 14), "ShotPuff", 0)
			SHTZ A 0 A_FireBullets (10, 1, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			SHTZ A 0 A_FireBullets (6, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
			PKBA B 1 Bright A_AlertMonsters
			TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
			TNT1 AAAAAAAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-4, 4), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			QBSG A 0 A_SetPitch(pitch - 5)
			
			QSGK AABBCDDEF 1 A_SetPitch(pitch + 0.5)
			QBSG A 2 
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 1, 2)
			TNT1 A 0 
			goto reload
			TNT1 A 0
			Goto Ready
		SingleFire:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 1, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/sg")
			QBSG A 0 A_GunFlash

			TNT1 A 0 A_Recoil(2)
			PKBR A 1 Bright Offset(0, 34) A_FireBullets(5, 4, 10, random(7, 14), "ShotPuff", 0)
			PKBR B 1 Bright Offset(0, 37) A_AlertMonsters
			TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
			QBSG A 0 A_SetPitch(pitch + 0.6)
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-2, 2), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			QBSG A 0 A_SetPitch(-5.0 + pitch)
			QBSG A 1 Offset(0, 36)
			QBSG A 1 Offset(0, 33)
			QBSG AAAA 2 A_SetPitch(pitch + 0.6)
			QBSG A 1
			Goto Ready
		AltFire:
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 1, 1)
			Goto NoAmmo
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 4, "AltFire1")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 3, "AltFire2")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 2, "AltFire3")
			QBSG A 0 A_JumpIfInventory("QSSGAmmo", 1, "AltFire4")
			Goto Ready
		AltFire1:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 1, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/sg")
			TNT1 A 0 A_AlertMonsters
			RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))

			TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
			PKTR A 1 Bright A_FireBullets(5, 4, 10, 11, "ShotgunPuff", FBF_NORANDOM)
			PKTR A 1 Bright A_SpawnItemEx("PlayerMuzzle1",30,5,30) 
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			TNT1 A 0 A_Recoil(2)
			QBSG A 0 A_SetPitch(-5.0 + pitch)

			TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			TNT1 AAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-2, 2), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			
			QSGK DEF 2 A_SetPitch(pitch + 1)
			QBSG A 2 
			Goto Ready
		AltFire2:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 1, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/sg")
			TNT1 A 0 A_AlertMonsters
			RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))

			TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
			PKTL A 1 Bright A_FireBullets(5, 4, 10, 11, "ShotgunPuff", FBF_NORANDOM)
			PKTL A 1 Bright A_SpawnItemEx("PlayerMuzzle1",30,5,30) 
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			TNT1 A 0 A_Recoil(2)
			QBSG A 0 A_SetPitch(-5.0 + pitch)

			TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			TNT1 AAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-2, 2), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			
			QSGK DEF 2 A_SetPitch(pitch + 1)
			QBSG A 2 
			Goto Ready
		AltFire3:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 1, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/sg")
			TNT1 A 0 A_AlertMonsters
			RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))

			TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
			PKBL A 1 Bright A_FireBullets(5, 4, 10, 11, "ShotgunPuff", FBF_NORANDOM)
			PKBL A 1 Bright A_SpawnItemEx("PlayerMuzzle1",30,5,30) 
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			TNT1 A 0 A_Recoil(2)
			QBSG A 0 A_SetPitch(-2.5 + pitch)

			TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			TNT1 AAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			QBSG A 0 A_FireCustomMissile("SmokeSpawner", 0, 0, random(-2, 2), 0)
			QBSG AAAA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 5)
			
			QSGK DEF 2 A_SetPitch(pitch + 0.5)
			
			QBSG A 1 A_Refire
			Goto Ready
		AltFire4:
			QBSG A 0 A_TakeInventory("QSSGAmmo", 1, TIF_NOTAKEINFINITE)
			QBSG A 0 A_PlayWeaponSound("weapons/sg")
			TNT1 A 0 A_AlertMonsters
			RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, -12, 0, random(-1,1))

			TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
			PKBR A 1 Bright A_FireBullets(5, 4, 10, 11, "ShotgunPuff", FBF_NORANDOM)
			PKBR A 1 Bright A_SpawnItemEx("PlayerMuzzle1",30,5,30) 
			TNT1 AAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-5,5), 0, 0, -12, 0, random(-5,5))
			TNT1 A 0 A_Recoil(2)
			QBSG A 0 A_SetPitch(pitch - 2.5)
			TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
			TNT1 AAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-12,12), 0, -1, 0, 0, random(-9,9))
			TNT1 AAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-12,12), 0, -1, 0, 0, random(-9,9))
			
			QSGK DEF 2 A_SetPitch(pitch + 0.5)
			QBSG A 1
		
		Reload:
			TNT1 A 0 A_TakeInventory("Reloading",1)
			TNT1 A 0 A_JumpIfInventory("QSSGAmmo", 4, "Ready")
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "ReallyReload")
			Goto Ready
		ReallyReload:
			TNT1 A 0 A_SetCrosshair(41)
			PKS2 BCDE 2
			quad B 0 A_JumpIfInventory("QSSGAmmo", 3, "Reload1")
			quad B 0 A_JumpIfInventory("QSSGAmmo", 2, "Reload2")
			quad B 0 A_JumpIfInventory("QSSGAmmo", 1, "Reload3")
		Reload4:
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 4, 4)
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 3, "Reload3")
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 2, "Reload2")
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "Reload1")
			PKS2 E 2 A_PlayWeaponSound("weapons/quadshotgun/open")
			PKS2 FFFF 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			QSGR ABCD 2
			PKS2 J 0 A_GiveInventory("QSSGAmmo", 2)
			PKS2 J 0 A_TakeInventory("AmmoShell", 2)
			QSGR E 1 A_PlayWeaponSound("weapons/quadshotgun/load")
			QSGR FGHI 2
			PKS2 P 0 A_GiveInventory("QSSGAmmo", 2)
			PKS2 P 0 A_TakeInventory("AmmoShell", 2)
			QSGR J 1 A_PlayWeaponSound("weapons/quadshotgun/load")
		
			PKS1 ABCD 3
			PKS1 E 1 A_PlayWeaponSound("weapons/quadshotgun/close")
			PKS1 F 2
			PKS1 G 1
			PKS1 H 1
			PKS1 I 1
			QBSG A 4
			QBSG A 1 A_Refire
			Goto Ready
		Reload3:
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 3, 3)
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 2, "Reload2")
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "Reload1")
			PKS2 E 2 A_PlayWeaponSound("weapons/quadshotgun/open")
			PKS2 FFF 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			PKS2 LOPQ 3
			PKS2 P 0 A_GiveInventory("QSSGAmmo", 1)
			PKS2 P 0 A_TakeInventory("AmmoShell", 1)
			PKS2 R 1 A_PlayWeaponSound("weapons/quadshotgun/load")
			
			QSGR FGHI 2
			PKS2 P 0 A_GiveInventory("QSSGAmmo", 2)
			PKS2 P 0 A_TakeInventory("AmmoShell", 2)
			QSGR J 1 A_PlayWeaponSound("weapons/quadshotgun/load")
			
			PKS1 ABCD 3
			PKS1 E 1 A_PlayWeaponSound("weapons/quadshotgun/close")
			PKS1 F 2
			PKS1 G 1
			PKS1 H 1
			PKS1 I 1
			QBSG A 4
			QBSG A 1 A_Refire
			Goto Ready
		Reload2:
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 2, 2)
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, "Reload1")
			PKS2 E 2 A_PlayWeaponSound("weapons/quadshotgun/open")
			PKS2 FF 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			QSGR FGHI 2
			PKS2 P 0 A_GiveInventory("QSSGAmmo", 2)
			PKS2 P 0 A_TakeInventory("AmmoShell", 2)
			QSGR J 1 A_PlayWeaponSound("weapons/quadshotgun/load")
			PKS1 ABCD 3
			PKS1 E 1 A_PlayWeaponSound("weapons/quadshotgun/close")
			PKS1 F 2
			PKS1 G 1
			PKS1 H 1
			PKS1 I 1
			QBSG A 4
			QBSG A 1 A_Refire
			Goto Ready
		Reload1:
			TNT1 A 0 A_JumpIfInventory("AmmoShell", 1, 1)
			Goto Ready
			PKS2 E 2 A_PlayWeaponSound("weapons/quadshotgun/open")
			PKS2 F 0 A_FireCustomMissile("SSGCaseSpawner",0,0,-10, -20)
			PKS2 WXYZ 3
			PKS2 Z 0 A_GiveInventory("QSSGAmmo", 1)
			PKS2 Z 0 A_TakeInventory("AmmoShell", 1)
			PKS2 Z 1 A_PlayWeaponSound("weapons/quadshotgun/load")
			PKS1 ABCD 3
			PKS1 E 1 A_PlayWeaponSound("weapons/quadshotgun/close")
			PKS1 F 2
			PKS1 G 1
			PKS1 H 1
			PKS1 I 1
			QBSG A 4
			QBSG A 1 A_Refire
			Goto Ready
		
		Flash:
			TNT1 A 5 Bright A_Light1
			TNT1 A 3 Bright A_Light2
			Goto LightDone
		
		NoAmmo:
			QBSG A 4
			TNT1 A 0 A_PlaySound("weapons/common/empty", 0)
			QBSG A 8
			Goto Reload
	}
}

Actor QSSGAmmo : Ammo
{
	+IGNORESKILL
	Inventory.Icon "QSGSA0"
	Inventory.MaxAmount 4
}